namespace SqlQueryBuilder.Util
{
    /// <summary>
    /// Class than resolve the format pattern of a DateTime depending on the cultural language
    /// </summary>
    public class CultureDate
    {
        private readonly CultureDateType language;

        /// <summary>
        /// Initializes a new instance of the <see cref="CultureDate"/> class.
        /// </summary>
        /// <param name="language">The language.</param>
        public CultureDate(CultureDateType language)
        {
            this.language = language;
        }

        /// <summary>
        /// Gets the tamplate.
        /// </summary>
        /// <returns></returns>
        public string GetTemplate()
        {
            switch (language)
            {
                case CultureDateType.Hijri: return "dd/MM/yy hh:mm:ss";
                case CultureDateType.ISO8601: return "yyyy-MM-ddThh:mm:ss";
                case CultureDateType.BritishFrench: return "dd/MM/yyyy";
                case CultureDateType.Italian: return "dd-MM-yy";
                case CultureDateType.ISO: return "yyyyMMdd";
                case CultureDateType.US: return "MM/dd/yyyy";
                case CultureDateType.ODBC:
                default: return "yyyy-MM-dd hh:mm:ss";          // ODBC
            }
        }
    }
}